﻿<%@ Page Title="Employees (Without Account)" Language="C#" MasterPageFile="~/SysAdmin/MasterPage_SysAdmin.master" AutoEventWireup="true" CodeBehind="Accounts.aspx.cs" Inherits="Ones.SysAdmin.Accounts" %>

<%@ Register TagPrefix="uc" TagName="Pager" Src="~/Utils/UserControls/Pager.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server"> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
    <div class="row">
        <div class="col-lg-12">
            <div class="alert alert-block alert-danger fade in" id="lockedMsg" runat="server">
                <button type="button" class="close close-sm" data-dismiss="alert">
                    <i class="icon-remove"></i>
                </button>
                <strong>Account is locked !</strong> You successfully lock an account.
            </div>
            <div class="alert alert-success fade in" id="unlockedMsg" runat="server">
                <button type="button" class="close close-sm" data-dismiss="alert">
                    <i class="icon-remove"></i>
                </button>
                <strong>Account is unlocked !</strong> You successfully unlock an account.
            </div>
            <div class="widget">
                <div class="widget-header">
                    <i class="icon-table"></i>
                    <h3>
                        Employees (Have Account)
                    </h3>
                    <div class="dataTables_filter" id="example_filter">
                        <asp:DropDownList runat="server" class="form-control required" Style="width: 160px; display: inline;" ID="ddlSearchBy">
                            <asp:ListItem Value="name" Text="Search by name"></asp:ListItem>
                            <asp:ListItem Value="empId" Text="Search by ID"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:TextBox runat="server" ID="txtSearch" style="height: 40px; margin-top: 10px; margin-right: 7px;" aria-controls="example"></asp:TextBox>
                        <asp:Button runat="server" Text="Search" ID="btnSearch" class="btn btn-sm btn-default" style="margin-right: 10px;" onclick="btnSearch_Click"/>
                    </div>
                </div>
                <div class="widget-content">
                    <div class="example_alt_pagination">
                        <div id="container">
                            <div class="full_width big"> </div>
                            <div id="demo">
                                <!--------- CONTENT TABLE ------------->
                                <asp:Repeater ID="employeeList" runat="server" OnItemCommand="employeeList_ItemCommand">
                                    <HeaderTemplate>
                                        <table class="display data-table">
                                            <thead>
                                                <tr>
                                                    <th>
                                                        Employee ID
                                                    </th>
                                                    <th>
                                                        Full Name
                                                    </th>
                                                    <th>
                                                        User Name
                                                    </th>
                                                    <th>
                                                        Gender
                                                    </th>
                                                    <th>
                                                        Role
                                                    </th>
                                                    <th>
                                                        Active
                                                    </th>
                                                    <th>
                                                        Action
                                                    </th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr class='<%#Container.ItemIndex % 2 == 0 ? "gradeA odd" : "gradeA even" %>'>
                                            <td>
                                            <%#DataBinder.Eval(Container.DataItem, "empId") %>
                                            </td>
                                            <td>
                                            <%#DataBinder.Eval(Container.DataItem, "empFirstName") %>
                                            <%#DataBinder.Eval(Container.DataItem, "empLastName") %>
                                            </td>
                                            <td>
                                            <%#DataBinder.Eval(Container.DataItem, "UserName") %>
                                            </td>
                                            <td>
                                            <%# (bool)DataBinder.Eval(Container.DataItem, "empGender") == true ? "Male &#9794" : "Female &#9792"%>
                                            </td>
                                            <td>
                                            <%#DataBinder.Eval(Container.DataItem, "RoleName") %>
                                            </td>
                                            <td>
                                            <%# (bool)DataBinder.Eval(Container.DataItem, "IsApproved") %>
                                            </td>
                                            <td class="hidden-xs">
                                                <asp:Button ID="Button1" class="btn btn-sm btn-primary" runat="server" Text="&nbsp;Detail&nbsp;" CommandName="detail" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "userId") %>' UseSubmitBehavior="false"/>
                                                <asp:Button Visible='<%# (bool)DataBinder.Eval(Container.DataItem, "IsApproved") == true ? true : false %>' class="btn btn-sm btn-danger" runat="server" Text="&nbsp;&nbsp;Lock&nbsp;&nbsp;" CommandName="lock" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "userId") %>' UseSubmitBehavior="false"/>
                                                <asp:Button Visible='<%# (bool)DataBinder.Eval(Container.DataItem, "IsApproved") == false ? true : false %>' class="btn btn-sm btn-success" runat="server" Text="Unlock" CommandName="unlock" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "userId") %>' UseSubmitBehavior="false"/>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        </tbody> </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                                <div class="clearfix">
                                    <uc:Pager ID="pager" runat="server" Url="Accounts.aspx"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphScript" runat="server"> </asp:Content>
